package xyz.lwm.lazycat.ds;

import lombok.Data;

import java.util.Properties;

/**
 * datasource properties
 *
 * @author lwm
 */
@Data
public class DatasourceProperties {

    /**
     * The instance class name of DatasourceProvider, use {@link HikariDatasourceProvider} as default
     */
    private String datasourceProvider = "xyz.lwm.lazycat.ds.HikariDatasourceProvider";
    private String driverClassName;
    private String url;
    private String username;
    private String password;
    private String poolName = "LazycatHikariCP";
    private String validationQuery = null;
    private Integer minimumIdle = 1; // 连接池中最小空闲连接数
    private Integer maximumPoolSize = 10; // 连接池中最大连接数
    private Long idleTimeout = 600000L; // 连接允许最长空闲时间,如果连接空闲时间超过1分钟,则会被关闭
    private Long maxLifetime = 1800000L; // 连接最长生命周期,当连接存活时间达到30分钟之后会被关闭作退休处理
    private Long validationTimeout = 5000L; // 测试连接是否空闲的间隔
    private Long leakDetectionThreshold = 120000L;
    private Properties properties; // 补充属性

}
